﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DocumentStorage.EFRepository.Contexts;
using DocumentStorage.EFRepository.Interfaces;
using DocumentStorage.Models;
using DocumentStorage.Repository;

namespace DocumentStorage.EFRepository.Repositories
{
  public class DocumentRepository : BaseEfRepository<Document>, IDocumentRepository
  {
    public DocumentRepository(string connectionString)
      : base(new DocumentDbContext(connectionString))
    {
    }

    public Document GetDocument(int id)
    {
      return (from d in Entities
              where d.Id == id
              select d).FirstOrDefault();
    }
  }
}
